﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OracleClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Windows.Forms;
using BLL;
using Util;
using Model;


namespace happyMusic
{
    public partial class test4 : System.Web.UI.Page
    {
        UserService userService = new UserService();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            /**
            * 3.DataTable方式查询                 
            */
            User user = new User();
            user.UserNo = TextBox1.Text.ToString().Trim();
            DataTable dt = userService.GetUserTableByUserNo(user);
            //取值方式一：
            string str = dt.Rows[0]["USER_NAME_CH"].ToString();
            MessageBox.Show(str);
            //取值方式二：
            //for (int i = 0; i < dt.Rows.Count; i++)

            //{
            //    string str = dt.Rows[i]["USER_NAME_CH"].ToString();

            //    MessageBox.Show(str);

            //}      
        }
    }
}